use async_std::io;
use libwebserver::HttpServer::server::Server;
use libwebserver::HttpServer::request::Request;
use libwebserver::HttpServer::response::Response;
fn main() -> io::Result<()>{
    let  server = Server::new("127.0.0.1", 9030);
    server.add_route::<Box<dyn Fn(Request, Response)>>("/", Box::new(|request: Request,mut response:Response|{
        println!("访问/");
        response.send("aaa".as_bytes());
    }))
    .add_route::<Box<dyn Fn(Request, Response)>>("/aa", Box::new(|request:Request,mut response:Response|{
        println!("访问/aa");
    }))
    .add_route::<Box<dyn Fn(Request, Response)>>("/bb", Box::new(|request:Request,mut response:Response|{
        println!("访问/bb");
    }))
    .run();
    Ok(())
}